﻿using System;
using System.IO;
using UnityEngine;

namespace SEXY
{
	// Token: 0x020002A8 RID: 680
	public class CharSave_SexyBeachPR
	{
		// Token: 0x06001143 RID: 4419 RVA: 0x0006ED7C File Offset: 0x0006CF7C
		public CharSave_SexyBeachPR(CharSave_SexyBeachPR.ConvertType type)
		{
			this.convertType = type;
			this.savedata = new CharSave_SexyBeachPR.SaveData();
		}

		// Token: 0x170001A3 RID: 419
		// (get) Token: 0x06001144 RID: 4420 RVA: 0x0006ED98 File Offset: 0x0006CF98
		// (set) Token: 0x06001145 RID: 4421 RVA: 0x0006EDA0 File Offset: 0x0006CFA0
		public CharSave_SexyBeachPR.SaveData savedata { get; private set; }

		// Token: 0x170001A4 RID: 420
		// (get) Token: 0x06001146 RID: 4422 RVA: 0x0006EDAC File Offset: 0x0006CFAC
		// (set) Token: 0x06001147 RID: 4423 RVA: 0x0006EDB4 File Offset: 0x0006CFB4
		public CharSave_SexyBeachPR.ConvertType convertType { get; private set; }

		// Token: 0x06001148 RID: 4424 RVA: 0x0006EDC0 File Offset: 0x0006CFC0
		public string GetFileTag(string filepath = "")
		{
			string result = string.Empty;
			if (!File.Exists(filepath))
			{
				return result;
			}
			using (FileStream fileStream = new FileStream(filepath, FileMode.Open, FileAccess.Read))
			{
				using (BinaryReader binaryReader = new BinaryReader(fileStream))
				{
					if (binaryReader.BaseStream.Length == 0L)
					{
						GlobalData.Debug_LogError("数据被破坏。");
						return result;
					}
					long num = 0L;
					PngAssist.CheckPngData(binaryReader, ref num, true);
					result = binaryReader.ReadString();
				}
			}
			return result;
		}

		// Token: 0x06001149 RID: 4425 RVA: 0x0006EE6C File Offset: 0x0006D06C
		public bool LoadCharaFile(string filepath = "")
		{
			if (!File.Exists(filepath))
			{
				return false;
			}
			this.savedata.fileName = Path.GetFileName(filepath);
			bool result = false;
			using (FileStream fileStream = new FileStream(filepath, FileMode.Open, FileAccess.Read))
			{
				using (BinaryReader binaryReader = new BinaryReader(fileStream))
				{
					result = this.LoadCharaFile(binaryReader);
				}
			}
			return result;
		}

		// Token: 0x0600114A RID: 4426 RVA: 0x0006EEF4 File Offset: 0x0006D0F4
		public bool LoadCharaFile(BinaryReader br)
		{
			if (br.BaseStream.Length == 0L)
			{
				GlobalData.Debug_LogError("数据被破坏。");
				return false;
			}
			this.savedata.pngData = PngAssist.LoadPngData(br);
			string a = br.ReadString();
			byte sex;
			if (a == "【PremiumResortCharaFemale】")
			{
				sex = 1;
			}
			else
			{
				if (!(a == "【PremiumResortCharaMale】"))
				{
					GlobalData.Debug_LogError("不同类型的文件。");
					return false;
				}
				sex = 0;
			}
			this.savedata.sex = sex;
			this.savedata.fileVersion = br.ReadInt32();
			if (this.savedata.fileVersion > 1)
			{
				GlobalData.Debug_LogError("比可执行文件更新的角色文件。");
				return false;
			}
			if (this.savedata.pngData != null && this.convertType == CharSave_SexyBeachPR.ConvertType.HoneySelect)
			{
				Texture2D texture2D = new Texture2D(0, 0, TextureFormat.ARGB32, false);
				texture2D.LoadImage(this.savedata.pngData);
				TextureScale.Bilinear(texture2D, 252, 352);
				this.savedata.pngData = texture2D.EncodeToPNG();
			}
			int num = br.ReadInt32();
			BlockHeader[] array = new BlockHeader[num];
			for (int i = 0; i < num; i++)
			{
				array[i] = new BlockHeader();
				array[i].LoadHeader(br);
			}
			int num2 = 0;
			num2++;
			this.savedata.customVersion = array[num2].version;
			if (this.savedata.customVersion > 5)
			{
				GlobalData.Debug_LogError("比可执行文件更新的自定义设置。");
			}
			else
			{
				br.BaseStream.Seek(array[num2].pos, SeekOrigin.Begin);
				byte[] data = br.ReadBytes((int)array[num2].size);
				if (!this.LoadCustomData(data, array[num2].version, sex))
				{
					GlobalData.Debug_LogError("自定义设置的加载失败了");
					return false;
				}
			}
			num2++;
			this.savedata.clothesVersion = array[num2].version;
			if (array[num2].version > 2)
			{
				GlobalData.Debug_LogError("比可执行文件更新颖的服装设计。");
			}
			else
			{
				br.BaseStream.Seek(array[num2].pos, SeekOrigin.Begin);
				byte[] data2 = br.ReadBytes((int)array[num2].size);
				if (!this.LoadClothesData(data2, array[num2].version, sex))
				{
					GlobalData.Debug_LogError("我们没能读取服装设定");
					return false;
				}
			}
			return true;
		}

		// Token: 0x0600114B RID: 4427 RVA: 0x0006F15C File Offset: 0x0006D35C
		public bool LoadCustomData(byte[] data, int version, byte sex)
		{
			bool result;
			using (MemoryStream memoryStream = new MemoryStream(data))
			{
				using (BinaryReader binaryReader = new BinaryReader(memoryStream))
				{
					binaryReader.BaseStream.Seek(1L, SeekOrigin.Current);
					this.savedata.personality = binaryReader.ReadInt32();
					this.savedata.name = binaryReader.ReadString();
					this.savedata.headId = binaryReader.ReadInt32();
					this.savedata.sbpr_shapeFace = new float[(sex != 0) ? 67 : 67];
					if (version < 3)
					{
						for (int i = 0; i < 66; i++)
						{
							this.savedata.sbpr_shapeFace[i] = (float)binaryReader.ReadDouble();
						}
					}
					else
					{
						for (int j = 0; j < this.savedata.sbpr_shapeFace.Length; j++)
						{
							this.savedata.sbpr_shapeFace[j] = (float)binaryReader.ReadDouble();
						}
					}
					this.savedata.sbpr_shapeBody = new float[(sex != 0) ? 32 : 21];
					for (int k = 0; k < this.savedata.sbpr_shapeBody.Length; k++)
					{
						this.savedata.sbpr_shapeBody[k] = (float)binaryReader.ReadDouble();
					}
					this.savedata.hairId = new int[(sex != 0) ? 4 : 1];
					for (int l = 0; l < this.savedata.hairId.Length; l++)
					{
						this.savedata.hairId[l] = binaryReader.ReadInt32();
					}
					this.savedata.hairColor = new CharSave_SexyBeachPR.ColorSetSBPR[(sex != 0) ? 4 : 1];
					for (int m = 0; m < this.savedata.hairColor.Length; m++)
					{
						this.savedata.hairColor[m] = new CharSave_SexyBeachPR.ColorSetSBPR();
						this.savedata.hairColor[m].Load(binaryReader, (int)this.convertType);
					}
					this.savedata.hairAcsColor = new CharSave_SexyBeachPR.ColorSetSBPR[(sex != 0) ? 4 : 1];
					for (int n = 0; n < this.savedata.hairAcsColor.Length; n++)
					{
						this.savedata.hairAcsColor[n] = new CharSave_SexyBeachPR.ColorSetSBPR();
						this.savedata.hairAcsColor[n].Load(binaryReader, (int)this.convertType);
					}
					this.savedata.texFaceId = binaryReader.ReadInt32();
					this.savedata.skinColor = new CharSave_SexyBeachPR.ColorSetSBPR();
					this.savedata.skinColor.Load(binaryReader, (int)this.convertType);
					if (sex == 1)
					{
						this.savedata.texEyeshadowId = binaryReader.ReadInt32();
						this.savedata.eyeshadowColor = new CharSave_SexyBeachPR.ColorSetSBPR();
						this.savedata.eyeshadowColor.Load(binaryReader, (int)this.convertType);
						this.savedata.texCheekId = binaryReader.ReadInt32();
						this.savedata.cheekColor = new CharSave_SexyBeachPR.ColorSetSBPR();
						this.savedata.cheekColor.Load(binaryReader, (int)this.convertType);
						this.savedata.texLipId = binaryReader.ReadInt32();
						this.savedata.lipColor = new CharSave_SexyBeachPR.ColorSetSBPR();
						this.savedata.lipColor.Load(binaryReader, (int)this.convertType);
					}
					this.savedata.texTattoo_fId = binaryReader.ReadInt32();
					this.savedata.tattoo_fColor = new CharSave_SexyBeachPR.ColorSetSBPR();
					this.savedata.tattoo_fColor.Load(binaryReader, (int)this.convertType);
					if (sex == 1)
					{
						this.savedata.texMoleId = binaryReader.ReadInt32();
						this.savedata.moleColor = new CharSave_SexyBeachPR.ColorSetSBPR();
						this.savedata.moleColor.Load(binaryReader, (int)this.convertType);
					}
					this.savedata.matEyebrowId = binaryReader.ReadInt32();
					this.savedata.eyebrowColor = new CharSave_SexyBeachPR.ColorSetSBPR();
					this.savedata.eyebrowColor.Load(binaryReader, (int)this.convertType);
					if (sex == 1)
					{
						this.savedata.matEyelashesId = binaryReader.ReadInt32();
						this.savedata.eyelashesColor = new CharSave_SexyBeachPR.ColorSetSBPR();
						this.savedata.eyelashesColor.Load(binaryReader, (int)this.convertType);
					}
					this.savedata.matEyeLId = binaryReader.ReadInt32();
					this.savedata.eyeLColor = new CharSave_SexyBeachPR.ColorSetSBPR();
					this.savedata.eyeLColor.Load(binaryReader, (int)this.convertType);
					this.savedata.matEyeRId = binaryReader.ReadInt32();
					this.savedata.eyeRColor = new CharSave_SexyBeachPR.ColorSetSBPR();
					this.savedata.eyeRColor.Load(binaryReader, (int)this.convertType);
					if (sex == 1)
					{
						this.savedata.matEyeHiId = binaryReader.ReadInt32();
						this.savedata.eyeHiColor = new CharSave_SexyBeachPR.ColorSetSBPR();
						this.savedata.eyeHiColor.Load(binaryReader, (int)this.convertType);
					}
					this.savedata.eyeWColor = new CharSave_SexyBeachPR.ColorSetSBPR();
					this.savedata.eyeWColor.Load(binaryReader, (int)this.convertType);
					if (version >= 2)
					{
						this.savedata.faceDetailWeight = (float)binaryReader.ReadDouble();
					}
					this.savedata.texBodyId = binaryReader.ReadInt32();
					if (sex == 1)
					{
						this.savedata.texSunburnId = binaryReader.ReadInt32();
						this.savedata.sunburnColor = new CharSave_SexyBeachPR.ColorSetSBPR();
						this.savedata.sunburnColor.Load(binaryReader, (int)this.convertType);
					}
					this.savedata.texTattoo_bId = binaryReader.ReadInt32();
					this.savedata.tattoo_bColor = new CharSave_SexyBeachPR.ColorSetSBPR();
					this.savedata.tattoo_bColor.Load(binaryReader, (int)this.convertType);
					if (sex == 1)
					{
						this.savedata.matNipId = binaryReader.ReadInt32();
						this.savedata.nipColor = new CharSave_SexyBeachPR.ColorSetSBPR();
						this.savedata.nipColor.Load(binaryReader, (int)this.convertType);
						this.savedata.matUnderhairId = binaryReader.ReadInt32();
						this.savedata.underhairColor = new CharSave_SexyBeachPR.ColorSetSBPR();
						this.savedata.underhairColor.Load(binaryReader, (int)this.convertType);
						this.savedata.nailColor = new CharSave_SexyBeachPR.ColorSetSBPR();
						this.savedata.nailColor.Load(binaryReader, (int)this.convertType);
						if (version >= 1)
						{
							this.savedata.nipSize = (float)binaryReader.ReadDouble();
						}
					}
					if (version >= 2)
					{
						this.savedata.bodyDetailWeight = (float)binaryReader.ReadDouble();
						if (this.convertType == CharSave_SexyBeachPR.ConvertType.HoneySelect)
						{
							this.savedata.bodyDetailWeight *= 0.6f;
						}
					}
					if (sex == 0)
					{
						this.savedata.beardId = binaryReader.ReadInt32();
						this.savedata.beardColor = new CharSave_SexyBeachPR.ColorSetSBPR();
						this.savedata.beardColor.Load(binaryReader, (int)this.convertType);
					}
					else
					{
						if (version >= 4)
						{
							binaryReader.BaseStream.Seek(4L, SeekOrigin.Current);
						}
						if (version >= 5)
						{
							this.savedata.bustSoftness = (float)binaryReader.ReadDouble();
							this.savedata.bustWeight = (float)binaryReader.ReadDouble();
						}
					}
					if (this.convertType == CharSave_SexyBeachPR.ConvertType.HoneySelect)
					{
						if (sex == 1)
						{
							if (14 > this.savedata.personality || this.savedata.personality > 18)
							{
								this.savedata.personality = 0;
							}
							else
							{
								this.savedata.personality -= 14;
							}
							int[] array = new int[]
							{
								0,
								2,
								3,
								3,
								0,
								1,
								2,
								2,
								1,
								4,
								2,
								5,
								0,
								4,
								1,
								5,
								4,
								4,
								3,
								3,
								3,
								2,
								3,
								4,
								5,
								0,
								5,
								0,
								1,
								5,
								0,
								0,
								2,
								5,
								3,
								3,
								5,
								5,
								5,
								2,
								0
							};
							this.savedata.hairType = array[this.savedata.hairId[0]];
						}
						else
						{
							this.savedata.personality = 0;
						}
						this.ConvertShapeValue();
					}
					result = true;
				}
			}
			return result;
		}

		// Token: 0x0600114C RID: 4428 RVA: 0x0006F97C File Offset: 0x0006DB7C
		public void ConvertShapeValue()
		{
			if (this.convertType == CharSave_SexyBeachPR.ConvertType.HoneySelect)
			{
				if (this.savedata.sex == 0)
				{
					this.savedata.shapeBody = new float[21];
					for (int i = 0; i < this.savedata.shapeBody.Length; i++)
					{
						this.savedata.shapeBody[i] = this.savedata.sbpr_shapeBody[i];
					}
					this.savedata.shapeFace = new float[67];
					int[] array = new int[]
					{
						0,
						1,
						2,
						3,
						4,
						5,
						6,
						7,
						8,
						9,
						10,
						11,
						12,
						27,
						28,
						29,
						30,
						31,
						32,
						49,
						65,
						50,
						51,
						52,
						33,
						34,
						35,
						36,
						37,
						38,
						39,
						40,
						41,
						42,
						43,
						44,
						45,
						46,
						47,
						48,
						13,
						14,
						15,
						16,
						17,
						18,
						19,
						20,
						21,
						66,
						22,
						23,
						24,
						25,
						26,
						58,
						59,
						60,
						61,
						62,
						63,
						64,
						53,
						54,
						55,
						56,
						57
					};
					for (int j = 0; j < 67; j++)
					{
						this.savedata.shapeFace[j] = this.savedata.sbpr_shapeFace[array[j]];
					}
				}
				else
				{
					this.savedata.shapeBody = new float[32];
					for (int k = 0; k < this.savedata.shapeBody.Length; k++)
					{
						this.savedata.shapeBody[k] = this.savedata.sbpr_shapeBody[k];
					}
					this.savedata.shapeFace = new float[67];
					int[] array2 = new int[]
					{
						0,
						1,
						2,
						3,
						4,
						5,
						6,
						7,
						8,
						9,
						10,
						11,
						12,
						27,
						28,
						29,
						30,
						31,
						32,
						48,
						49,
						50,
						51,
						52,
						33,
						34,
						35,
						36,
						37,
						38,
						65,
						39,
						40,
						41,
						42,
						43,
						44,
						45,
						46,
						47,
						13,
						14,
						15,
						16,
						17,
						18,
						19,
						20,
						21,
						66,
						22,
						23,
						24,
						25,
						26,
						58,
						59,
						60,
						61,
						62,
						63,
						64,
						53,
						54,
						55,
						56,
						57
					};
					for (int l = 0; l < 67; l++)
					{
						this.savedata.shapeFace[l] = this.savedata.sbpr_shapeFace[array2[l]];
					}
				}
			}
		}

		// Token: 0x0600114D RID: 4429 RVA: 0x0006FAF0 File Offset: 0x0006DCF0
		public bool LoadClothesData(byte[] data, int version, byte sex)
		{
			bool result;
			using (MemoryStream memoryStream = new MemoryStream(data))
			{
				using (BinaryReader binaryReader = new BinaryReader(memoryStream))
				{
					this.savedata.coord = new CharSave_SexyBeachPR.Coordinate[2];
					binaryReader.BaseStream.Seek(1L, SeekOrigin.Current);
					for (int i = 0; i < this.savedata.coord.Length; i++)
					{
						this.savedata.coord[i] = new CharSave_SexyBeachPR.Coordinate();
						if (sex == 0)
						{
							this.savedata.coord[i].clothesTopId = binaryReader.ReadInt32();
							this.savedata.coord[i].shoesId = binaryReader.ReadInt32();
							if (version >= 2)
							{
								this.savedata.coord[i].clothesTopColor = new CharSave_SexyBeachPR.ColorSetSBPR();
								this.savedata.coord[i].clothesTopColor.Load(binaryReader, (int)this.convertType);
								this.savedata.coord[i].shoesColor = new CharSave_SexyBeachPR.ColorSetSBPR();
								this.savedata.coord[i].shoesColor.Load(binaryReader, (int)this.convertType);
							}
						}
						else
						{
							this.savedata.coord[i].clothesTopId = binaryReader.ReadInt32();
							this.savedata.coord[i].clothesBotId = binaryReader.ReadInt32();
							this.savedata.coord[i].braId = binaryReader.ReadInt32();
							this.savedata.coord[i].shortsId = binaryReader.ReadInt32();
							this.savedata.coord[i].glovesId = binaryReader.ReadInt32();
							this.savedata.coord[i].panstId = binaryReader.ReadInt32();
							this.savedata.coord[i].socksId = binaryReader.ReadInt32();
							this.savedata.coord[i].shoesId = binaryReader.ReadInt32();
							this.savedata.coord[i].swimsuitId = binaryReader.ReadInt32();
							this.savedata.coord[i].swimTopId = binaryReader.ReadInt32();
							this.savedata.coord[i].swimBotId = binaryReader.ReadInt32();
							if (this.convertType == CharSave_SexyBeachPR.ConvertType.HoneySelect)
							{
								if (this.savedata.coord[i].clothesTopId == 102 || this.savedata.coord[i].clothesTopId == 111)
								{
									this.savedata.coord[i].clothesTopId = 101;
								}
								if (this.savedata.coord[i].clothesBotId == 82)
								{
									this.savedata.coord[i].clothesBotId = 0;
								}
								if (this.savedata.coord[i].swimsuitId == 46)
								{
									this.savedata.coord[i].swimsuitId = 50;
								}
							}
							if (version >= 2)
							{
								this.savedata.coord[i].clothesTopColor = new CharSave_SexyBeachPR.ColorSetSBPR();
								this.savedata.coord[i].clothesTopColor.Load(binaryReader, (int)this.convertType);
								this.savedata.coord[i].clothesBotColor = new CharSave_SexyBeachPR.ColorSetSBPR();
								this.savedata.coord[i].clothesBotColor.Load(binaryReader, (int)this.convertType);
								this.savedata.coord[i].braColor = new CharSave_SexyBeachPR.ColorSetSBPR();
								this.savedata.coord[i].braColor.Load(binaryReader, (int)this.convertType);
								this.savedata.coord[i].shortsColor = new CharSave_SexyBeachPR.ColorSetSBPR();
								this.savedata.coord[i].shortsColor.Load(binaryReader, (int)this.convertType);
								this.savedata.coord[i].glovesColor = new CharSave_SexyBeachPR.ColorSetSBPR();
								this.savedata.coord[i].glovesColor.Load(binaryReader, (int)this.convertType);
								this.savedata.coord[i].panstColor = new CharSave_SexyBeachPR.ColorSetSBPR();
								this.savedata.coord[i].panstColor.Load(binaryReader, (int)this.convertType);
								this.savedata.coord[i].socksColor = new CharSave_SexyBeachPR.ColorSetSBPR();
								this.savedata.coord[i].socksColor.Load(binaryReader, (int)this.convertType);
								this.savedata.coord[i].shoesColor = new CharSave_SexyBeachPR.ColorSetSBPR();
								this.savedata.coord[i].shoesColor.Load(binaryReader, (int)this.convertType);
								this.savedata.coord[i].swimsuitColor = new CharSave_SexyBeachPR.ColorSetSBPR();
								this.savedata.coord[i].swimsuitColor.Load(binaryReader, (int)this.convertType);
								this.savedata.coord[i].swimTopColor = new CharSave_SexyBeachPR.ColorSetSBPR();
								this.savedata.coord[i].swimTopColor.Load(binaryReader, (int)this.convertType);
								this.savedata.coord[i].swimBotColor = new CharSave_SexyBeachPR.ColorSetSBPR();
								this.savedata.coord[i].swimBotColor.Load(binaryReader, (int)this.convertType);
							}
						}
					}
					if (sex == 0)
					{
						if (version >= 2)
						{
							binaryReader.BaseStream.Seek(1L, SeekOrigin.Current);
						}
					}
					else if (version >= 1)
					{
						this.savedata.stateSwimOptTop = binaryReader.ReadByte();
						this.savedata.stateSwimOptBot = binaryReader.ReadByte();
						binaryReader.BaseStream.Seek(1L, SeekOrigin.Current);
					}
					this.savedata.accessory = new CharSave_SexyBeachPR.Accessory[2, 5];
					this.savedata.accessoryColor = new CharSave_SexyBeachPR.ColorSetSBPR[2, 5];
					for (int j = 0; j < 2; j++)
					{
						for (int k = 0; k < 5; k++)
						{
							this.savedata.accessory[j, k] = new CharSave_SexyBeachPR.Accessory();
							this.savedata.accessory[j, k].Load(binaryReader);
							if (version >= 2)
							{
								this.savedata.accessoryColor[j, k] = new CharSave_SexyBeachPR.ColorSetSBPR();
								this.savedata.accessoryColor[j, k].Load(binaryReader, (int)this.convertType);
							}
						}
					}
					result = true;
				}
			}
			return result;
		}

		// Token: 0x040012D0 RID: 4816
		public const string CharaFileFemaleDir = "chara/female/";

		// Token: 0x040012D1 RID: 4817
		public const string CharaFileMaleDir = "chara/male/";

		// Token: 0x040012D2 RID: 4818
		public const string CharaFileFemaleMark = "【PremiumResortCharaFemale】";

		// Token: 0x040012D3 RID: 4819
		public const string CharaFileMaleMark = "【PremiumResortCharaMale】";

		// Token: 0x040012D4 RID: 4820
		public const int CharaFileVersion = 1;

		// Token: 0x040012D5 RID: 4821
		public const int PreviewVersion = 1;

		// Token: 0x040012D6 RID: 4822
		public const int CustomVersion = 5;

		// Token: 0x040012D7 RID: 4823
		public const int ClothesVersion = 2;

		// Token: 0x040012D8 RID: 4824
		public const int MaleShapeFaceNum = 67;

		// Token: 0x040012D9 RID: 4825
		public const int MaleShapeBodyNum = 21;

		// Token: 0x040012DA RID: 4826
		public const int FemaleShapeFaceNum = 67;

		// Token: 0x040012DB RID: 4827
		public const int FemaleShapeBodyNum = 32;

		// Token: 0x040012DC RID: 4828
		public const int CoordinateNum = 2;

		// Token: 0x040012DD RID: 4829
		public const int AccessorySlotNum = 5;

		// Token: 0x020002A9 RID: 681
		public class ColorSetSBPR
		{
			// Token: 0x0600114F RID: 4431 RVA: 0x000701DC File Offset: 0x0006E3DC
			public void Load(BinaryReader reader, int convertType)
			{
				this.diffuseColor.H = (float)reader.ReadDouble();
				this.diffuseColor.S = (float)reader.ReadDouble();
				this.diffuseColor.V = (float)reader.ReadDouble();
				this.alpha = (float)reader.ReadDouble();
				this.specularColor.H = (float)reader.ReadDouble();
				this.specularColor.S = (float)reader.ReadDouble();
				this.specularColor.V = (float)reader.ReadDouble();
				this.specularIntensity = (float)reader.ReadDouble();
				this.specularSharpness = (float)reader.ReadDouble();
				if (convertType == 0)
				{
					this.specularIntensity = Mathf.InverseLerp(0f, 5f, this.specularIntensity) * 0.8f;
					this.specularSharpness = Mathf.InverseLerp(0f, 9f, this.specularSharpness) * 0.9f;
				}
			}

			// Token: 0x06001150 RID: 4432 RVA: 0x000702C4 File Offset: 0x0006E4C4
			public void CopyToHoneySelect(HSColorSet dst)
			{
				dst.hsvDiffuse.Copy(this.diffuseColor);
				dst.alpha = this.alpha;
				dst.hsvSpecular.Copy(this.specularColor);
				dst.specularIntensity = this.specularIntensity;
				dst.specularSharpness = this.specularSharpness;
			}

			// Token: 0x040012E0 RID: 4832
			public HsvColor diffuseColor = new HsvColor(20f, 0.8f, 0.8f);

			// Token: 0x040012E1 RID: 4833
			public float alpha = 1f;

			// Token: 0x040012E2 RID: 4834
			public HsvColor specularColor = new HsvColor(0f, 0f, 0.8f);

			// Token: 0x040012E3 RID: 4835
			public float specularIntensity = 0.5f;

			// Token: 0x040012E4 RID: 4836
			public float specularSharpness = 3f;
		}

		// Token: 0x020002AA RID: 682
		public class Coordinate
		{
			// Token: 0x040012E5 RID: 4837
			public int clothesTopId;

			// Token: 0x040012E6 RID: 4838
			public CharSave_SexyBeachPR.ColorSetSBPR clothesTopColor;

			// Token: 0x040012E7 RID: 4839
			public int clothesBotId;

			// Token: 0x040012E8 RID: 4840
			public CharSave_SexyBeachPR.ColorSetSBPR clothesBotColor;

			// Token: 0x040012E9 RID: 4841
			public int braId;

			// Token: 0x040012EA RID: 4842
			public CharSave_SexyBeachPR.ColorSetSBPR braColor;

			// Token: 0x040012EB RID: 4843
			public int shortsId;

			// Token: 0x040012EC RID: 4844
			public CharSave_SexyBeachPR.ColorSetSBPR shortsColor;

			// Token: 0x040012ED RID: 4845
			public int glovesId;

			// Token: 0x040012EE RID: 4846
			public CharSave_SexyBeachPR.ColorSetSBPR glovesColor;

			// Token: 0x040012EF RID: 4847
			public int panstId;

			// Token: 0x040012F0 RID: 4848
			public CharSave_SexyBeachPR.ColorSetSBPR panstColor;

			// Token: 0x040012F1 RID: 4849
			public int socksId;

			// Token: 0x040012F2 RID: 4850
			public CharSave_SexyBeachPR.ColorSetSBPR socksColor;

			// Token: 0x040012F3 RID: 4851
			public int shoesId;

			// Token: 0x040012F4 RID: 4852
			public CharSave_SexyBeachPR.ColorSetSBPR shoesColor;

			// Token: 0x040012F5 RID: 4853
			public int swimsuitId;

			// Token: 0x040012F6 RID: 4854
			public CharSave_SexyBeachPR.ColorSetSBPR swimsuitColor;

			// Token: 0x040012F7 RID: 4855
			public int swimTopId;

			// Token: 0x040012F8 RID: 4856
			public CharSave_SexyBeachPR.ColorSetSBPR swimTopColor;

			// Token: 0x040012F9 RID: 4857
			public int swimBotId;

			// Token: 0x040012FA RID: 4858
			public CharSave_SexyBeachPR.ColorSetSBPR swimBotColor;
		}

		// Token: 0x020002AB RID: 683
		public class Accessory
		{
			// Token: 0x06001153 RID: 4435 RVA: 0x00070370 File Offset: 0x0006E570
			public void Load(BinaryReader reader)
			{
				this.accessoryType = reader.ReadInt32();
				this.accessoryId = reader.ReadInt32();
				this.parentKey = reader.ReadString();
				this.plusPos.x = (float)reader.ReadDouble();
				this.plusPos.y = (float)reader.ReadDouble();
				this.plusPos.z = (float)reader.ReadDouble();
				this.plusRot.x = (float)reader.ReadDouble();
				this.plusRot.y = (float)reader.ReadDouble();
				this.plusRot.z = (float)reader.ReadDouble();
				this.plusScl.x = (float)reader.ReadDouble();
				this.plusScl.y = (float)reader.ReadDouble();
				this.plusScl.z = (float)reader.ReadDouble();
			}

			// Token: 0x040012FB RID: 4859
			public int accessoryType = -1;

			// Token: 0x040012FC RID: 4860
			public int accessoryId = -1;

			// Token: 0x040012FD RID: 4861
			public string parentKey = string.Empty;

			// Token: 0x040012FE RID: 4862
			public Vector3 plusPos = Vector3.zero;

			// Token: 0x040012FF RID: 4863
			public Vector3 plusRot = Vector3.zero;

			// Token: 0x04001300 RID: 4864
			public Vector3 plusScl = Vector3.one;
		}

		// Token: 0x020002AC RID: 684
		public class SaveData
		{
			// Token: 0x04001301 RID: 4865
			public string fileName = string.Empty;

			// Token: 0x04001302 RID: 4866
			public byte[] pngData;

			// Token: 0x04001303 RID: 4867
			public int fileVersion;

			// Token: 0x04001304 RID: 4868
			public byte sex;

			// Token: 0x04001305 RID: 4869
			public int customVersion;

			// Token: 0x04001306 RID: 4870
			public int personality;

			// Token: 0x04001307 RID: 4871
			public string name = string.Empty;

			// Token: 0x04001308 RID: 4872
			public int headId;

			// Token: 0x04001309 RID: 4873
			public float[] sbpr_shapeFace;

			// Token: 0x0400130A RID: 4874
			public float[] sbpr_shapeBody;

			// Token: 0x0400130B RID: 4875
			public float[] shapeFace;

			// Token: 0x0400130C RID: 4876
			public float[] shapeBody;

			// Token: 0x0400130D RID: 4877
			public int[] hairId;

			// Token: 0x0400130E RID: 4878
			public int hairType;

			// Token: 0x0400130F RID: 4879
			public CharSave_SexyBeachPR.ColorSetSBPR[] hairColor;

			// Token: 0x04001310 RID: 4880
			public CharSave_SexyBeachPR.ColorSetSBPR[] hairAcsColor;

			// Token: 0x04001311 RID: 4881
			public int texFaceId;

			// Token: 0x04001312 RID: 4882
			public CharSave_SexyBeachPR.ColorSetSBPR skinColor;

			// Token: 0x04001313 RID: 4883
			public int texEyeshadowId;

			// Token: 0x04001314 RID: 4884
			public CharSave_SexyBeachPR.ColorSetSBPR eyeshadowColor;

			// Token: 0x04001315 RID: 4885
			public int texCheekId;

			// Token: 0x04001316 RID: 4886
			public CharSave_SexyBeachPR.ColorSetSBPR cheekColor;

			// Token: 0x04001317 RID: 4887
			public int texLipId;

			// Token: 0x04001318 RID: 4888
			public CharSave_SexyBeachPR.ColorSetSBPR lipColor;

			// Token: 0x04001319 RID: 4889
			public int texTattoo_fId;

			// Token: 0x0400131A RID: 4890
			public CharSave_SexyBeachPR.ColorSetSBPR tattoo_fColor;

			// Token: 0x0400131B RID: 4891
			public int texMoleId;

			// Token: 0x0400131C RID: 4892
			public CharSave_SexyBeachPR.ColorSetSBPR moleColor;

			// Token: 0x0400131D RID: 4893
			public int matEyebrowId;

			// Token: 0x0400131E RID: 4894
			public CharSave_SexyBeachPR.ColorSetSBPR eyebrowColor;

			// Token: 0x0400131F RID: 4895
			public int matEyelashesId;

			// Token: 0x04001320 RID: 4896
			public CharSave_SexyBeachPR.ColorSetSBPR eyelashesColor;

			// Token: 0x04001321 RID: 4897
			public int matEyeLId;

			// Token: 0x04001322 RID: 4898
			public CharSave_SexyBeachPR.ColorSetSBPR eyeLColor;

			// Token: 0x04001323 RID: 4899
			public int matEyeRId;

			// Token: 0x04001324 RID: 4900
			public CharSave_SexyBeachPR.ColorSetSBPR eyeRColor;

			// Token: 0x04001325 RID: 4901
			public int matEyeHiId;

			// Token: 0x04001326 RID: 4902
			public CharSave_SexyBeachPR.ColorSetSBPR eyeHiColor;

			// Token: 0x04001327 RID: 4903
			public CharSave_SexyBeachPR.ColorSetSBPR eyeWColor;

			// Token: 0x04001328 RID: 4904
			public float faceDetailWeight;

			// Token: 0x04001329 RID: 4905
			public int texBodyId;

			// Token: 0x0400132A RID: 4906
			public int texSunburnId;

			// Token: 0x0400132B RID: 4907
			public CharSave_SexyBeachPR.ColorSetSBPR sunburnColor;

			// Token: 0x0400132C RID: 4908
			public int texTattoo_bId;

			// Token: 0x0400132D RID: 4909
			public CharSave_SexyBeachPR.ColorSetSBPR tattoo_bColor;

			// Token: 0x0400132E RID: 4910
			public int matNipId;

			// Token: 0x0400132F RID: 4911
			public CharSave_SexyBeachPR.ColorSetSBPR nipColor;

			// Token: 0x04001330 RID: 4912
			public int matUnderhairId;

			// Token: 0x04001331 RID: 4913
			public CharSave_SexyBeachPR.ColorSetSBPR underhairColor;

			// Token: 0x04001332 RID: 4914
			public CharSave_SexyBeachPR.ColorSetSBPR nailColor;

			// Token: 0x04001333 RID: 4915
			public float nipSize = 0.5f;

			// Token: 0x04001334 RID: 4916
			public float bodyDetailWeight;

			// Token: 0x04001335 RID: 4917
			public int beardId;

			// Token: 0x04001336 RID: 4918
			public CharSave_SexyBeachPR.ColorSetSBPR beardColor;

			// Token: 0x04001337 RID: 4919
			public float bustSoftness = 0.5f;

			// Token: 0x04001338 RID: 4920
			public float bustWeight = 0.5f;

			// Token: 0x04001339 RID: 4921
			public int clothesVersion;

			// Token: 0x0400133A RID: 4922
			public CharSave_SexyBeachPR.Coordinate[] coord;

			// Token: 0x0400133B RID: 4923
			public byte stateSwimOptTop;

			// Token: 0x0400133C RID: 4924
			public byte stateSwimOptBot;

			// Token: 0x0400133D RID: 4925
			public CharSave_SexyBeachPR.Accessory[,] accessory;

			// Token: 0x0400133E RID: 4926
			public CharSave_SexyBeachPR.ColorSetSBPR[,] accessoryColor;
		}

		// Token: 0x020002AD RID: 685
		public enum ConvertType
		{
			// Token: 0x04001340 RID: 4928
			HoneySelect
		}
	}
}
